//
// Created by 32513 on 25-4-9.
//

#include "Servo.h"

#include <tim.h>

#include "cmsis_os2.h"
#include "stm32f4xx_hal_tim.h"

void Servo_Init(void)
{
    HAL_TIM_PWM_Start(&htim8, TIM_CHANNEL_3);  //推杆舵机，倒数第二外面接口
    HAL_TIM_PWM_Start(&htim8, TIM_CHANNEL_4);  //挡板舵机，最外面的接口
    Put_Up();

}
void Put_Down()
{
    __HAL_TIM_SetCompare(&htim8, TIM_CHANNEL_4, 150);

}
void Put_Up()
{
    __HAL_TIM_SetCompare(&htim8, TIM_CHANNEL_4, 50);

}
void Shoot()
{
    __HAL_TIM_SetCompare(&htim8,TIM_CHANNEL_3,50);
    osDelay(300);
    __HAL_TIM_SetCompare(&htim8,TIM_CHANNEL_3,150);

}
